package edu.whu.demo.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import edu.whu.demo.entity.Item;
import edu.whu.demo.entity.ItemDto;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ItemMybatisPlusMapper extends BaseMapper<Item> {
    @Select("SELECT * FROM items")
    @Results({@Result(id = true, property = "id", column = "id"),
            @Result(property = "suppliers", column = "id",
                    many = @Many(select = "edu.whu.demo.dao.SupplierMybatisPlusMapper.findSuppliersByItemId"))
    })
    List<ItemDto> findAllItemVo();
}
